Skip to content

test: one contract per file (satisfy rainix single-contract gate)#129

Merged
thedavidmeister merged 2 commits into
mainfrom
2026-06-15-one-contract-per-file
Jun 16, 2026
Merged

test: one contract per file (satisfy rainix single-contract gate)#129
thedavidmeister merged 2 commits into
mainfrom
2026-06-15-one-contract-per-file

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

The rainix rainix-sol-single-contract gate (added in rainlanguage/rainix#214) is failing on main because a test .sol file declares more than one contract. This greens main and unblocks #128.

The gate's authoritative output flagged a single violation:

ERROR: test/lib/LibDescribedByMeta.emitForDescribedAddress.t.sol declares 2 contracts; Rain convention is one contract per file.

Files split

  • test/lib/LibDescribedByMeta.emitForDescribedAddress.t.sol (was 2 contracts) -> keeps the primary test contract LibDescribedByMetaEmitForDescribedAddressTest; the TestDescribedByMetaV1 mock is moved to the new file test/lib/TestDescribedByMetaV1.sol. The original file now imports the moved mock so all references resolve.

This is a pure file reorganization: no test logic or contract code changed.

Verification (rainix sol-shell)

  • rainix-sol-single-contract exits 0 (no violations remain).
  • forge build clean.
  • forge fmt --check clean.
  • forge test for the split contract: 2 passed, 0 failed (5096 fuzz runs each). The only failures in the full suite are pre-existing and environment-gated (missing *_RPC_URL env vars and the yq binary), unrelated to this change.

🤖 Generated with Claude Code

Split test/lib/LibDescribedByMeta.emitForDescribedAddress.t.sol so each
.sol file declares exactly one contract, as required by the rainix
rainix-sol-single-contract gate.

The TestDescribedByMetaV1 mock is moved to its own file
test/lib/TestDescribedByMetaV1.sol; the primary test contract
LibDescribedByMetaEmitForDescribedAddressTest stays in the original file
and imports the moved mock. Pure file reorganization, no behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 26 minutes and 36 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6d8114c5-4cd1-4f57-b845-a6d439156464

📥 Commits

Reviewing files that changed from the base of the PR and between 80ae37d and 34d892a.

📒 Files selected for processing (2)
  • test/lib/LibDescribedByMeta.emitForDescribedAddress.t.sol
  • test/lib/TestDescribedByMetaV1.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-15-one-contract-per-file

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Reviewed 34d892a: approved by maintainer; re-triggered against fixed rainix main (LICENSE symlink #232) — single-contract gate + license-staging now green, mergeable. Merging.

@thedavidmeister thedavidmeister merged commit 573a16a into main Jun 16, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant